#include<iostream>
#include<vector>
using namespace std;

int main() {
    int t, n, temp;
    cin >> t;
    vector<int> a;
    while(t--) {
        a.clear();
        cin >> n;
        while(n--) {
            cin >> temp;
            if(find(a.begin(), a.end(), temp) == a.end())
                a.push_back(temp);
        }
        for(auto i : a) {
            cout << i << " ";
        }
        cout << endl;
    }
    return 0;
} 